package com.maxatime.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.maxatime.dao.GradeStudentRelationMapper;
import com.maxatime.pojo.entity.DetailGrade;
import com.maxatime.pojo.entity.GradeStudentRelation;
import com.maxatime.service.GradeStudentRelationService;


@Service
public class GradeStudentRelationServiceImpl implements GradeStudentRelationService{
	
	@Autowired
	GradeStudentRelationMapper gradeStudentRelationMapper;
	
	//查询
	@Override
	public List<DetailGrade> listData(String gradeId) {
		// TODO Auto-generated method stub
		List<DetailGrade> list = gradeStudentRelationMapper.selectData(gradeId);
		return list;
	}
	//删除
	@Override
	public int xqdelete(String studentId) {
		// TODO Auto-generated method stub
		gradeStudentRelationMapper.xqdelete(studentId);
		return 0;
	}
	//新增查询详情
	@Override
	public List<DetailGrade> selectByPrimaryKey(DetailGrade detailGrade) {
		// TODO Auto-generated method stub
		List<DetailGrade> list=gradeStudentRelationMapper.selectByPrimaryKey1(detailGrade);
		return list;
	}
	//新增
	@Override
	public int insertSelective(GradeStudentRelation record) {
		// TODO Auto-generated method stub
		record.setDeleteFlag("0");
		Date Date = new Date();
		record.setCreateTime(Date);
		record.setUpdateTime(Date);
		
		int xz = gradeStudentRelationMapper.insertSelective(record);
		return xz;
	}

	
}
